package top.z.work.module.system.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

import java.io.Serial;

/**
 * 表定义层。
 *
 * @author zaoangod
 * @since 2024-07-26
 */
public class SystemLoggerAccessTableDef extends TableDef {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    public static final SystemLoggerAccessTableDef SYSTEM_LOGGER_ACCESS = new SystemLoggerAccessTableDef();

    /**
     * 用户编号
     */
    public final QueryColumn USER_ID = new QueryColumn(this, "user_id");

    /**
     * 结束请求时间
     */
    public final QueryColumn END_TIME = new QueryColumn(this, "end_time");

    /**
     * 链路追踪编号
     */
    public final QueryColumn TRACE_ID = new QueryColumn(this, "trace_id");

    /**
     * 执行时长, 单位:毫秒
     */
    public final QueryColumn DURATION = new QueryColumn(this, "duration");

    /**
     * 数据ID
     */
    public final QueryColumn IDENTITY = new QueryColumn(this, "identity");

    /**
     * 开始请求时间
     */
    public final QueryColumn BEGIN_TIME = new QueryColumn(this, "begin_time");

    /**
     * 用户 IP
     */
    public final QueryColumn REQUEST_IP = new QueryColumn(this, "request_ip");

    /**
     * 浏览器UA
     */
    public final QueryColumn USER_AGENT = new QueryColumn(this, "user_agent");

    /**
     * 访问地址
     */
    public final QueryColumn REQUEST_URL = new QueryColumn(this, "request_url");

    /**
     * 结果码
     */
    public final QueryColumn RESULT_CODE = new QueryColumn(this, "result_code");

    /**
     * 操作名
     */
    public final QueryColumn OPERATE_NAME = new QueryColumn(this, "operate_name");

    /**
     * 操作分类
     */
    public final QueryColumn OPERATE_TYPE = new QueryColumn(this, "operate_type");

    /**
     * 响应结果
     */
    public final QueryColumn RESPONSE_BODY = new QueryColumn(this, "response_body");

    /**
     * 操作模块
     */
    public final QueryColumn OPERATE_MODULE = new QueryColumn(this, "operate_module");

    /**
     * 请求方法名
     */
    public final QueryColumn REQUEST_METHOD = new QueryColumn(this, "request_method");

    /**
     * 结果提示
     */
    public final QueryColumn RESULT_MESSAGE = new QueryColumn(this, "result_message");

    /**
     * 请求参数
     */
    public final QueryColumn REQUEST_PARAMETER = new QueryColumn(this, "request_parameter");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{IDENTITY, TRACE_ID, USER_ID, REQUEST_METHOD, REQUEST_URL, REQUEST_PARAMETER, REQUEST_IP, USER_AGENT, RESPONSE_BODY, OPERATE_MODULE, OPERATE_NAME, OPERATE_TYPE, BEGIN_TIME, END_TIME, DURATION, RESULT_CODE, RESULT_MESSAGE};

    public SystemLoggerAccessTableDef() {
        super("", "system_logger_access");
    }

}
